;
$(function () {

    var ad = appData(),sysImgObj={1:"assets/images/img_card1.png",2:"assets/images/img_card2.png"};

    sessionStorage.clear();
    showMenu();


    function showMenu() {
        ad.selectList("GET_SYS", {}, function (data) {
            $("#userName").text(data.user);
            if(Number(data.userManagerShow) ){
                $("#userManager").show();
                $("#userManager").attr("href",data.userManagerUrl);
            }
            else $("#userManager").hide();

            $(".home-link ul").empty();
            $.each(data.system,function () {
                var $li=$(	'<li class="li01"><a href="#"><img /></a></li>')
                $li.find("a").attr("href",this.url);
                $li.find("img").attr("src",sysImgObj[this.id]);
                $li.find("img").attr("alt",this.name);
                $(".home-link ul").append($li);
                $(".home-link li.li01").delay(300).animate({left: '0', opacity: '1'}, 1000);
            })
        })
    }


    $("#logOut").on("click", function () {
        window.location.href = appApi("LOGOUT");
    });

})